<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>日志概况</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport"
			content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../static/css/font.css">
		<link rel="stylesheet" href="../static/css/weadmin.css">
		<script src="../lib/layui/layui.js" charset="utf-8"></script>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	</head>

	<body>
		<div id="logApp">
			<div class="weadmin-nav" style="visibility: visible;">
				<span class="layui-breadcrumb">
					<a href="">首页</a>
					<a href="">管理员查询</a>
					<a><cite>日志概况</cite></a>
				</span>
			
			</div>
			<div class="weadmin-body">
				<div class="layui-row">
					<div class="layui-row">	
						日志搜索：(第一个时间是时间区间左端点，第二个时间是时间区间右端点，格式如 2022-1-1 22:30:56 采用24小时进制)
						<form class="layui-form layui-col-md12 we-search">
							
							<div class="layui-inline">
								<input type="text" name="username" placeholder="日志ID" autocomplete="off" class="layui-input" v-model="logId" />
							</div>
							<div class="layui-inline">
								<input type="text" name="username" placeholder="用户ID" autocomplete="off" class="layui-input" v-model="userId" />
							</div>
							<div class="layui-inline">
								<input type="text" name="username" placeholder="用户名" autocomplete="off" class="layui-input" v-model="userName" />
							</div>
							<div class="layui-inline">
								<input type="text" name="username" placeholder="(yyyy-MM-dd HH:mm:ss)" autocomplete="off" class="layui-input" v-model="createTime" />
							</div>
							<div class="layui-inline">
								<input type="text" name="username" placeholder="(yyyy-MM-dd HH:mm:ss)" autocomplete="off" class="layui-input" v-model="updateTime" />
							</div>
							<div class="layui-inline">
								<input type="text" name="username" placeholder="状态(0非法,1正常)" autocomplete="off" class="layui-input" v-model="state" />
							</div>
							<div class="layui-inline">
								<input type="text" name="username" placeholder="IP地址" autocomplete="off" class="layui-input" v-model="ip" />
							</div>
					
							<button class="layui-btn" type="button" @click="logListClick">
								<i class="layui-icon layui-icon-search"></i>
							</button>
						</form>
				</div>
				<table class="layui-table">
					<thead>
						<tr>
							<th>
								<input class="layui-form-checkbox" lay-skin="primary" type="checkbox" />
							</th>
							<th>日志ID</th>
							<th>用户ID</th>
							<th>用户名</th>
							<th>访问时间</th>
							<th>状态</th>
							<th>IP</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<tr v-for="(item,key) of logList">
							<td>
								<input class="layui-form-checkbox" lay-skin="primary" type="checkbox" />
							</td>
							<td>{{item.logId}}</td>
							<td>{{item.userId}}</td>
							<td>{{item.userName}}</td>
							<td>{{item.createTime}}</td>
							<td>{{item.state}}</td>
							<td>{{item.ip}}</td>
							<td class="td-manage">
								<a title="查看" onclick="WeAdminShow('订单详细信息','orgderDetails.html')" href="javascript:;">
									<i class="layui-icon">&#xe705;</i>
								</a>
								<a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
									<i class="layui-icon">&#xe640;</i>
								</a>
							</td>
						</tr>
					</tbody>
				</table>
				<!-- <div class="page">
					<div>
						<a class="prev" href="">&lt;&lt;</a>
						<a class="num" href="">1</a>
						<span class="current">2</span>
						<a class="num" href="">3</a>
						<a class="num" href="">489</a>
						<a class="next" href="">&gt;&gt;</a>
					</div>
				</div> -->
			</div>
		</div>
		
		
	</body>
	<script src="../static/js/admin.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/request.js"></script>
	<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
		
	<script type="text/javascript">
		

		var vm=new Vue({
			el:'#logApp',
			data:{
				logId: "",
				userId: "",
				userName: "",
				createTime: "",
				updateTime: "",
				state: "",
				ip: "",
				logList: []
			},
			methods:{
				callbackLogList(e) {
					if (e.flag && e.data != null && e.code == 20000) {
						this.logList = e.data
						console.log(this.logList)
					} else {
						window.alert(e.message)
					}
				},
				logListClick() {
					log = {}

					if (this.logId != "") {
						log["logId"] = this.logId
					}

					if (this.userId != "") {
						log["userId"] = this.userId
					}
					if (this.userName != "") {
						log["userName"] = this.userNam
					}
					if (this.createTime  != "") {
						log["createTime"] = this.createTime
					}
					if (this.updateTime != "") {
						log["updateTime"] = this.updateTime
					}
					if (this.state != "") {
						log["state"] = this.state
					}
					if (this.ip != "") {
						log["ip"] = this.ip
					}
				
					console.log(log)
					// 异步回调
					getLogList(log, this.callbackLogList)
					// console.log(JSON.parse(localStorage.userList))
				}
			}
		})
	</script>
</html>
